package org.icnmasjid.member.model;
// Generated Dec 6, 2008 9:23:43 PM by Hibernate Tools 3.1.0.beta4

import java.sql.Date;
import java.sql.Timestamp;


/**
 * @struts.form include-all="true" extends="BaseForm"
 * @hibernate.class
 *         table="person"
 *     
 */

public class Person extends org.icnmasjid.member.model.BaseObject implements java.io.Serializable {


    // Fields    

    private Integer personId;
    private String firstName;
    private String lastName;
    private Date birthYear;
    private String gender;
    private String email;
    private String email2;
    private String phoneHome;
    private String phoneWork;
    private String phoneMobile;
    private String phoneFax;
    private Timestamp createdDate;
    private Timestamp updatedDate;
    private Date residentStartDate;
    private Boolean citizen;
    private String updatedBy;
    private String personStatus;
    private String employerName;
    private Boolean primaryPerson;
    private Date dateOfBirth;
    private int version;


    // Constructors

    /** default constructor */
    public Person() {
    }

	/** minimal constructor */
    public Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }
    
    /** full constructor */
    public Person(String firstName, String lastName, Date birthYear, String gender, String email, String email2, String phoneHome, String phoneWork, String phoneMobile, String phoneFax, Timestamp createdDate, Timestamp updatedDate, Date residentStartDate, Boolean citizen, String updatedBy, String personStatus, String employerName, Boolean primaryPerson, Date dateOfBirth, int version) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.birthYear = birthYear;
        this.gender = gender;
        this.email = email;
        this.email2 = email2;
        this.phoneHome = phoneHome;
        this.phoneWork = phoneWork;
        this.phoneMobile = phoneMobile;
        this.phoneFax = phoneFax;
        this.createdDate = createdDate;
        this.updatedDate = updatedDate;
        this.residentStartDate = residentStartDate;
        this.citizen = citizen;
        this.updatedBy = updatedBy;
        this.personStatus = personStatus;
        this.employerName = employerName;
        this.primaryPerson = primaryPerson;
        this.dateOfBirth = dateOfBirth;
        this.version = version;
    }
    

   
    // Property accessors
    /**       
     *      *            @hibernate.id
     *             generator-class="native"
     *             type="java.lang.Integer"
     *             column="person_id"
     *         
     */

    public Integer getPersonId() {
        return this.personId;
    }
    
    public void setPersonId(Integer personId) {
        this.personId = personId;
    }
    /**       
     *      *            @hibernate.property
     *             column="first_name"
     *             length="50"
     *             not-null="true"
     *         
     */

    public String getFirstName() {
        return this.firstName;
    }
    
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    /**       
     *      *            @hibernate.property
     *             column="last_name"
     *             length="50"
     *             not-null="true"
     *         
     */

    public String getLastName() {
        return this.lastName;
    }
    
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    /**       
     *      *            @hibernate.property
     *             column="birth_year"
     *             length="4"
     *         
     */

    public Date getBirthYear() {
        return this.birthYear;
    }
    
    public void setBirthYear(Date birthYear) {
        this.birthYear = birthYear;
    }
    /**       
     *      *            @hibernate.property
     *             column="gender"
     *             length="1"
     *         
     */

    public String getGender() {
        return this.gender;
    }
    
    public void setGender(String gender) {
        this.gender = gender;
    }
    /**       
     *      *            @hibernate.property
     *             column="email"
     *             length="100"
     *         
     */

    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    /**       
     *      *            @hibernate.property
     *             column="email2"
     *             length="100"
     *         
     */

    public String getEmail2() {
        return this.email2;
    }
    
    public void setEmail2(String email2) {
        this.email2 = email2;
    }
    /**       
     *      *            @hibernate.property
     *             column="phone_home"
     *             length="20"
     *         
     */

    public String getPhoneHome() {
        return this.phoneHome;
    }
    
    public void setPhoneHome(String phoneHome) {
        this.phoneHome = phoneHome;
    }
    /**       
     *      *            @hibernate.property
     *             column="phone_work"
     *             length="20"
     *         
     */

    public String getPhoneWork() {
        return this.phoneWork;
    }
    
    public void setPhoneWork(String phoneWork) {
        this.phoneWork = phoneWork;
    }
    /**       
     *      *            @hibernate.property
     *             column="phone_mobile"
     *             length="20"
     *         
     */

    public String getPhoneMobile() {
        return this.phoneMobile;
    }
    
    public void setPhoneMobile(String phoneMobile) {
        this.phoneMobile = phoneMobile;
    }
    /**       
     *      *            @hibernate.property
     *             column="phone_fax"
     *             length="20"
     *         
     */

    public String getPhoneFax() {
        return this.phoneFax;
    }
    
    public void setPhoneFax(String phoneFax) {
        this.phoneFax = phoneFax;
    }
    /**       
     *      *            @hibernate.property
     *             column="created_date"
     *             length="19"
     *         
     */

    public Timestamp getCreatedDate() {
        return this.createdDate;
    }
    
    public void setCreatedDate(Timestamp createdDate) {
        this.createdDate = createdDate;
    }
    /**       
     *      *            @hibernate.property
     *             column="updated_date"
     *             length="19"
     *         
     */

    public Timestamp getUpdatedDate() {
        return this.updatedDate;
    }
    
    public void setUpdatedDate(Timestamp updatedDate) {
        this.updatedDate = updatedDate;
    }
    /**       
     *      *            @hibernate.property
     *             column="resident_start_date"
     *             length="10"
     *         
     */

    public Date getResidentStartDate() {
        return this.residentStartDate;
    }
    
    public void setResidentStartDate(Date residentStartDate) {
        this.residentStartDate = residentStartDate;
    }
    /**       
     *      *            @hibernate.property
     *             column="citizen"
     *             length="1"
     *         
     */

    public Boolean getCitizen() {
        return this.citizen;
    }
    
    public void setCitizen(Boolean citizen) {
        this.citizen = citizen;
    }
    /**       
     *      *            @hibernate.property
     *             column="updated_by"
     *             length="100"
     *         
     */

    public String getUpdatedBy() {
        return this.updatedBy;
    }
    
    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }
    /**       
     *      *            @hibernate.property
     *             column="person_status"
     *             length="20"
     *         
     */

    public String getPersonStatus() {
        return this.personStatus;
    }
    
    public void setPersonStatus(String personStatus) {
        this.personStatus = personStatus;
    }
    /**       
     *      *            @hibernate.property
     *             column="employer_name"
     *             length="100"
     *         
     */

    public String getEmployerName() {
        return this.employerName;
    }
    
    public void setEmployerName(String employerName) {
        this.employerName = employerName;
    }
    /**       
     *      *            @hibernate.property
     *             column="primary_person"
     *             length="1"
     *         
     */

    public Boolean getPrimaryPerson() {
        return this.primaryPerson;
    }
    
    public void setPrimaryPerson(Boolean primaryPerson) {
        this.primaryPerson = primaryPerson;
    }
    /**       
     *      *            @hibernate.property
     *             column="date_of_birth"
     *             length="10"
     *         
     */

    public Date getDateOfBirth() {
        return this.dateOfBirth;
    }
    
    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }
    /**       
     *      *            @hibernate.property
     *             column="version"
     *             length="10"
     *         
     */

    public int getVersion() {
        return this.version;
    }
    
    public void setVersion(int version) {
        this.version = version;
    }
   

    /**
     * toString
     * @return String
     */
     public String toString() {
	  StringBuffer buffer = new StringBuffer();

      buffer.append(getClass().getName()).append("@").append(Integer.toHexString(hashCode())).append(" [");
      buffer.append("firstName").append("='").append(getFirstName()).append("' ");			
      buffer.append("lastName").append("='").append(getLastName()).append("' ");			
      buffer.append("birthYear").append("='").append(getBirthYear()).append("' ");			
      buffer.append("gender").append("='").append(getGender()).append("' ");			
      buffer.append("email").append("='").append(getEmail()).append("' ");			
      buffer.append("email2").append("='").append(getEmail2()).append("' ");			
      buffer.append("phoneHome").append("='").append(getPhoneHome()).append("' ");			
      buffer.append("phoneWork").append("='").append(getPhoneWork()).append("' ");			
      buffer.append("phoneMobile").append("='").append(getPhoneMobile()).append("' ");			
      buffer.append("phoneFax").append("='").append(getPhoneFax()).append("' ");			
      buffer.append("createdDate").append("='").append(getCreatedDate()).append("' ");			
      buffer.append("updatedDate").append("='").append(getUpdatedDate()).append("' ");			
      buffer.append("residentStartDate").append("='").append(getResidentStartDate()).append("' ");			
      buffer.append("citizen").append("='").append(getCitizen()).append("' ");			
      buffer.append("updatedBy").append("='").append(getUpdatedBy()).append("' ");			
      buffer.append("personStatus").append("='").append(getPersonStatus()).append("' ");			
      buffer.append("employerName").append("='").append(getEmployerName()).append("' ");			
      buffer.append("primaryPerson").append("='").append(getPrimaryPerson()).append("' ");			
      buffer.append("dateOfBirth").append("='").append(getDateOfBirth()).append("' ");			
      buffer.append("version").append("='").append(getVersion()).append("' ");			
      buffer.append("]");
      
      return buffer.toString();
     }


   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
		 if ( (other == null ) ) return false;
		 if ( !(other instanceof Person) ) return false;
		 Person castOther = ( Person ) other; 
         
		 return ( (this.getPersonId()==castOther.getPersonId()) || ( this.getPersonId()!=null && castOther.getPersonId()!=null && this.getPersonId().equals(castOther.getPersonId()) ) )
 && ( (this.getFirstName()==castOther.getFirstName()) || ( this.getFirstName()!=null && castOther.getFirstName()!=null && this.getFirstName().equals(castOther.getFirstName()) ) )
 && ( (this.getLastName()==castOther.getLastName()) || ( this.getLastName()!=null && castOther.getLastName()!=null && this.getLastName().equals(castOther.getLastName()) ) )
 && ( (this.getBirthYear()==castOther.getBirthYear()) || ( this.getBirthYear()!=null && castOther.getBirthYear()!=null && this.getBirthYear().equals(castOther.getBirthYear()) ) )
 && ( (this.getGender()==castOther.getGender()) || ( this.getGender()!=null && castOther.getGender()!=null && this.getGender().equals(castOther.getGender()) ) )
 && ( (this.getEmail()==castOther.getEmail()) || ( this.getEmail()!=null && castOther.getEmail()!=null && this.getEmail().equals(castOther.getEmail()) ) )
 && ( (this.getEmail2()==castOther.getEmail2()) || ( this.getEmail2()!=null && castOther.getEmail2()!=null && this.getEmail2().equals(castOther.getEmail2()) ) )
 && ( (this.getPhoneHome()==castOther.getPhoneHome()) || ( this.getPhoneHome()!=null && castOther.getPhoneHome()!=null && this.getPhoneHome().equals(castOther.getPhoneHome()) ) )
 && ( (this.getPhoneWork()==castOther.getPhoneWork()) || ( this.getPhoneWork()!=null && castOther.getPhoneWork()!=null && this.getPhoneWork().equals(castOther.getPhoneWork()) ) )
 && ( (this.getPhoneMobile()==castOther.getPhoneMobile()) || ( this.getPhoneMobile()!=null && castOther.getPhoneMobile()!=null && this.getPhoneMobile().equals(castOther.getPhoneMobile()) ) )
 && ( (this.getPhoneFax()==castOther.getPhoneFax()) || ( this.getPhoneFax()!=null && castOther.getPhoneFax()!=null && this.getPhoneFax().equals(castOther.getPhoneFax()) ) )
 && ( (this.getCreatedDate()==castOther.getCreatedDate()) || ( this.getCreatedDate()!=null && castOther.getCreatedDate()!=null && this.getCreatedDate().equals(castOther.getCreatedDate()) ) )
 && ( (this.getUpdatedDate()==castOther.getUpdatedDate()) || ( this.getUpdatedDate()!=null && castOther.getUpdatedDate()!=null && this.getUpdatedDate().equals(castOther.getUpdatedDate()) ) )
 && ( (this.getResidentStartDate()==castOther.getResidentStartDate()) || ( this.getResidentStartDate()!=null && castOther.getResidentStartDate()!=null && this.getResidentStartDate().equals(castOther.getResidentStartDate()) ) )
 && ( (this.getCitizen()==castOther.getCitizen()) || ( this.getCitizen()!=null && castOther.getCitizen()!=null && this.getCitizen().equals(castOther.getCitizen()) ) )
 && ( (this.getUpdatedBy()==castOther.getUpdatedBy()) || ( this.getUpdatedBy()!=null && castOther.getUpdatedBy()!=null && this.getUpdatedBy().equals(castOther.getUpdatedBy()) ) )
 && ( (this.getPersonStatus()==castOther.getPersonStatus()) || ( this.getPersonStatus()!=null && castOther.getPersonStatus()!=null && this.getPersonStatus().equals(castOther.getPersonStatus()) ) )
 && ( (this.getEmployerName()==castOther.getEmployerName()) || ( this.getEmployerName()!=null && castOther.getEmployerName()!=null && this.getEmployerName().equals(castOther.getEmployerName()) ) )
 && ( (this.getPrimaryPerson()==castOther.getPrimaryPerson()) || ( this.getPrimaryPerson()!=null && castOther.getPrimaryPerson()!=null && this.getPrimaryPerson().equals(castOther.getPrimaryPerson()) ) )
 && ( (this.getDateOfBirth()==castOther.getDateOfBirth()) || ( this.getDateOfBirth()!=null && castOther.getDateOfBirth()!=null && this.getDateOfBirth().equals(castOther.getDateOfBirth()) ) )
 && (this.getVersion()==castOther.getVersion());
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( getPersonId() == null ? 0 : this.getPersonId().hashCode() );
         result = 37 * result + ( getFirstName() == null ? 0 : this.getFirstName().hashCode() );
         result = 37 * result + ( getLastName() == null ? 0 : this.getLastName().hashCode() );
         result = 37 * result + ( getBirthYear() == null ? 0 : this.getBirthYear().hashCode() );
         result = 37 * result + ( getGender() == null ? 0 : this.getGender().hashCode() );
         result = 37 * result + ( getEmail() == null ? 0 : this.getEmail().hashCode() );
         result = 37 * result + ( getEmail2() == null ? 0 : this.getEmail2().hashCode() );
         result = 37 * result + ( getPhoneHome() == null ? 0 : this.getPhoneHome().hashCode() );
         result = 37 * result + ( getPhoneWork() == null ? 0 : this.getPhoneWork().hashCode() );
         result = 37 * result + ( getPhoneMobile() == null ? 0 : this.getPhoneMobile().hashCode() );
         result = 37 * result + ( getPhoneFax() == null ? 0 : this.getPhoneFax().hashCode() );
         result = 37 * result + ( getCreatedDate() == null ? 0 : this.getCreatedDate().hashCode() );
         result = 37 * result + ( getUpdatedDate() == null ? 0 : this.getUpdatedDate().hashCode() );
         result = 37 * result + ( getResidentStartDate() == null ? 0 : this.getResidentStartDate().hashCode() );
         result = 37 * result + ( getCitizen() == null ? 0 : this.getCitizen().hashCode() );
         result = 37 * result + ( getUpdatedBy() == null ? 0 : this.getUpdatedBy().hashCode() );
         result = 37 * result + ( getPersonStatus() == null ? 0 : this.getPersonStatus().hashCode() );
         result = 37 * result + ( getEmployerName() == null ? 0 : this.getEmployerName().hashCode() );
         result = 37 * result + ( getPrimaryPerson() == null ? 0 : this.getPrimaryPerson().hashCode() );
         result = 37 * result + ( getDateOfBirth() == null ? 0 : this.getDateOfBirth().hashCode() );
         result = 37 * result + this.getVersion();
         return result;
   }   





}
